package com.cqd.entity;

import lombok.Data;

import javax.persistence.*;
import java.util.List;

@Entity
@Table(name = "t_menu")
@Data
public class Menu {

    @Id
    @Column(name = "id")
    private Long id;

    @Column(name = "mname")
    private String mname;

    @ManyToMany(cascade = CascadeType.ALL,fetch = FetchType.EAGER)
    @JoinTable(
            name = "base_role_menu",
            joinColumns = @JoinColumn(name = "mid",referencedColumnName = "id"),
            inverseJoinColumns = @JoinColumn(name="rid",referencedColumnName = "id")
    )

    private List<Role> listRole;
}
